/**************************************************************************************************
  Filename:       zcl_NewbitTemperatureHumiditySensor_data.c
  Revised:        $Date: 2014-09-25 13:20:41 -0700 (Thu, 25 Sep 2014) $
  Revision:       $Revision: 40295 $


  Description:    Zigbee Cluster Library - sample device application.


  Copyright 2013-2014 Texas Instruments Incorporated. All rights reserved.

  IMPORTANT: Your use of this Software is limited to those specific rights
  granted under the terms of a software license agreement between the user
  who downloaded the software, his/her employer (which must be your employer)
  and Texas Instruments Incorporated (the "License").  You may not use this
  Software unless you agree to abide by the terms of the License. The License
  limits your use, and you acknowledge, that the Software may not be modified,
  copied or distributed unless embedded on a Texas Instruments microcontroller
  or used solely and exclusively in conjunction with a Texas Instruments radio
  frequency transceiver, which is integrated into your product.  Other than for
  the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  works of, modify, distribute, perform, display or sell this Software and/or
  its documentation for any purpose.

  YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

  Should you have any questions regarding your right to use this Software,
  contact Texas Instruments Incorporated at www.TI.com.
**************************************************************************************************/

/*********************************************************************
 * INCLUDES
 */
#include "ZComDef.h"
#include "OSAL.h"
#include "AF.h"
#include "ZDConfig.h"

#include "zcl.h"
#include "zcl_general.h"
#include "zcl_ha.h"
#include "zcl_ms.h"
#include "zcl_hvac.h"

#include "zcl_NewbitTemperatureHumiditySensor.h"

/*********************************************************************
 * CONSTANTS
 */

#define TEMPERATURE_HUMIDITY_SENSOR_DEVICE_VERSION     0
#define TEMPERATURE_HUMIDITY_SENSOR_FLAGS              0

#define TEMPERATURE_HUMIDITY_SENSOR_HWVERSION          1
#define TEMPERATURE_HUMIDITY_SENSOR_ZCLVERSION         1
#define TEMPERATURE_HUMIDITY_SENSOR_APPVERSION         10

#define TEMPERATURE_SENSOR_MAX_MEASURED_VALUE  10000  // 27.00C
#define TEMPERATURE_SENSOR_MIN_MEASURED_VALUE  0  // 17.00C
#define TEMPERATURE_SENSOR_MEASURED_VALUE      0  // 20.00C
#define TEMPERATURE_SENSOR_TOLERANCE_VALUE     100   //1.00C


#define HUMIDITY_SENSOR_MAX_MEASURED_VALUE  10000  // 100%
#define HUMIDITY_SENSOR_MIN_MEASURED_VALUE  0  // 0%
#define HUMIDITY_SENSOR_MEASURED_VALUE      0  // 60%
#define HUMIDITY_SENSOR_TOLERANCE_VALUE     2000  // 20%

/*********************************************************************
 * TYPEDEFS
 */
/*********************************************************************
 * MACROS
 */

/*********************************************************************
 * GLOBAL VARIABLES
 */

// Global attributes
const uint16 zclTemperatureHumiditySensor_clusterRevision_all = 0x0001; 

#ifdef ZCL_BASIC
// Basic Cluster
const uint8 zclTemperatureHumiditySensor_HWRevision = TEMPERATURE_HUMIDITY_SENSOR_HWVERSION;
const uint8 zclTemperatureHumiditySensor_ZCLVersion = TEMPERATURE_HUMIDITY_SENSOR_ZCLVERSION;
const uint8 zclTemperatureHumiditySensor_APPVersion = TEMPERATURE_HUMIDITY_SENSOR_APPVERSION;
const uint8 zclTemperatureHumiditySensor_ManufacturerName[7] = { 6,'N','e','w','b','i','t' };
//const uint8 zclTemperatureHumiditySensor_ModelId[7] = { 6,'N','B','T','P','H','P' };//lumi.sensor_switch
const uint8 zclTemperatureHumiditySensor_ModelId[19] = { 18,'l','u','m','i','.','s','e','n','s','o','r','_','s','w','i','t','c','h' };//lumi.sensor_switch
const uint8 zclTemperatureHumiditySensor_DateCode[9] = { 8,'2','0','1','8','0','2','0','2'};
const uint8 zclTemperatureHumiditySensor_PowerSource = POWER_SOURCE_BATTERY;

uint8 zclTemperatureHumiditySensor_LocationDescription[17];
uint8 zclTemperatureHumiditySensor_PhysicalEnvironment;
uint8 zclTemperatureHumiditySensor_DeviceEnable;
XiaoMiIdentification_t XiaoMiIdentification = 
{
  .u8DataType0 = ZCL_DATATYPE_BOOLEAN,
  .bData0 = 0x00,
  .u8DataType1 = ZCL_DATATYPE_UINT16,
  .u16Data1 = 0x0C32,
  .u8DataType2 = ZCL_DATATYPE_UINT16,
  .u16Data2 = 0x01A8,
  .u8DataType3 = ZCL_DATATYPE_UINT40,
  .uDataBuff = {0,0,0,0,0},
  .u8DataType4 = ZCL_DATATYPE_UINT16,
  .u16Data4 = 0x001A,
  .u8DataType5 = ZCL_DATATYPE_UINT8,
  .u8Data5 = 0x51
};
#endif

#ifdef ZCL_IDENTIFY
// Identify Cluster
uint16 zclTemperatureHumiditySensor_IdentifyTime;
#endif
#ifdef ZCL_TEMPERATURE_MEASUREMENT
// Temperature Sensor Cluster
int16 zclTemperatureSensor_MeasuredValue =0;
const int16 zclTemperatureSensor_MinMeasuredValue = TEMPERATURE_SENSOR_MIN_MEASURED_VALUE; 
const int16 zclTemperatureSensor_MaxMeasuredValue = TEMPERATURE_SENSOR_MAX_MEASURED_VALUE;
const uint16 zclTemperatureSensor_ToleranceValue = TEMPERATURE_SENSOR_TOLERANCE_VALUE;
#endif

#ifdef ZCL_POWER_CFG
// Power Configuration Cluster
uint8 zclBatteryVoltage_MeasuredValue;
const uint8 zclBatteryPercentageRemaining; 
#endif

#ifdef ZCL_TIME
// Time Configuration Cluster
uint32 zclTemperatureHumiditySensor_Time;
UTCTimeStruct utc_struct = {40, 20, 15, 17, 8, 18};
#endif
#ifdef ZCL_RELATIVE_HUMIDITY
// Relative Humidity Cluster
uint16 zclHumiditySensor_MeasuredValue =0;
const uint16 zclHumiditySensor_MinMeasuredValue = HUMIDITY_SENSOR_MIN_MEASURED_VALUE; 
const uint16 zclHumiditySensor_MaxMeasuredValue = HUMIDITY_SENSOR_MAX_MEASURED_VALUE;
const uint16 zclHumiditySensor_ToleranceValue = HUMIDITY_SENSOR_TOLERANCE_VALUE;
#endif

#ifdef ZCL_HVAC_CLUSTER
FanMode_e zcl_FanMode_e8 = FAN_MODE_AUTO;
#endif
/*********************************************************************
 * ATTRIBUTE DEFINITIONS - Uses REAL cluster IDs
 */

// NOTE: The attributes listed in the AttrRec must be in ascending order 
// per cluster to allow right function of the Foundation discovery commands

CONST zclAttrRec_t zclTemperatureHumiditySensor_Attrs[] =
{
#ifdef ZCL_BASIC
  // *** General Basic Cluster Attributes ***
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_ZCL_VERSION,
      ZCL_DATATYPE_UINT8,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_ZCLVersion
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_APPL_VERSION,
      ZCL_DATATYPE_UINT8,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_APPVersion
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,             // Cluster IDs - defined in the foundation (ie. zcl.h)
    {  // Attribute record
      ATTRID_BASIC_HW_VERSION,            // Attribute ID - Found in Cluster Library header (ie. zcl_general.h)
      ZCL_DATATYPE_UINT8,                 // Data Type - found in zcl.h
      ACCESS_CONTROL_READ,                // Variable access control - found in zcl.h
      (void *)&zclTemperatureHumiditySensor_HWRevision  // Pointer to attribute variable
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_MANUFACTURER_NAME,
      ZCL_DATATYPE_CHAR_STR,
      ACCESS_CONTROL_READ,
      (void *)zclTemperatureHumiditySensor_ManufacturerName
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_MODEL_ID,
      ZCL_DATATYPE_CHAR_STR,
      ACCESS_CONTROL_READ,
      (void *)zclTemperatureHumiditySensor_ModelId
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_DATE_CODE,
      ZCL_DATATYPE_CHAR_STR,
      ACCESS_CONTROL_READ,
      (void *)zclTemperatureHumiditySensor_DateCode
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_POWER_SOURCE,
      ZCL_DATATYPE_ENUM8,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_PowerSource
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_LOCATION_DESC,
      ZCL_DATATYPE_CHAR_STR,
      (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
      (void *)zclTemperatureHumiditySensor_LocationDescription
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_PHYSICAL_ENV,
      ZCL_DATATYPE_ENUM8,
      (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
      (void *)&zclTemperatureHumiditySensor_PhysicalEnvironment
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    { // Attribute record
      ATTRID_BASIC_DEVICE_ENABLED,
      ZCL_DATATYPE_BOOLEAN,
      (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
      (void *)&zclTemperatureHumiditySensor_DeviceEnable
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_BASIC,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
  
   {
    ZCL_CLUSTER_ID_GEN_BASIC,
    {  // Attribute record
      ATTRID_XIAOMI_IDENTIFICATION,
      ZCL_DATATYPE_STRUCT,
      ACCESS_CONTROL_READ,
      (void *)&XiaoMiIdentification
    }
  },
#endif
#ifdef ZCL_IDENTIFY
  // *** Identify Cluster Attribute ***
  {
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    { // Attribute record
      ATTRID_IDENTIFY_TIME,
      ZCL_DATATYPE_UINT16,
      (ACCESS_CONTROL_READ | ACCESS_CONTROL_WRITE),
      (void *)&zclTemperatureHumiditySensor_IdentifyTime
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_IDENTIFY,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ | ACCESS_GLOBAL,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
#endif
#ifdef ZCL_TEMPERATURE_MEASUREMENT
  // *** Temperature Measurement Attriubtes ***
  {
    ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
    { // Attribute record
      ATTRID_MS_TEMPERATURE_MEASURED_VALUE,
      ZCL_DATATYPE_INT16,
      ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
      (void *)&zclTemperatureSensor_MeasuredValue
    }
  },
  {
    ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
    { // Attribute record
      ATTRID_MS_TEMPERATURE_MIN_MEASURED_VALUE,
      ZCL_DATATYPE_INT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureSensor_MinMeasuredValue
    }
  },
  {
    ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
    { // Attribute record
      ATTRID_MS_TEMPERATURE_MAX_MEASURED_VALUE,
      ZCL_DATATYPE_INT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureSensor_MaxMeasuredValue
    }
  },

  {
    ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
    {  // Attribute record
      ATTRID_MS_TEMPERATURE_TOLERANCE,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
  
  {
    ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
#endif
#ifdef ZCL_POWER_CFG  
    // *** Power Configuration Attriubtes ***
  {
    ZCL_CLUSTER_ID_GEN_POWER_CFG,
    { // Attribute record
      ATTRID_POWER_CFG_BATTERY_VOLTAGE,
      ZCL_DATATYPE_UINT8,
      ACCESS_CONTROL_READ,
      (void *)&zclBatteryVoltage_MeasuredValue
    }
  },
   {
    ZCL_CLUSTER_ID_GEN_POWER_CFG,
    { // Attribute record
      ATTRID_POWER_CFG_BATTERY_PERCENTAGE_REMAINING,
      ZCL_DATATYPE_UINT8,
      ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
      (void *)&zclBatteryPercentageRemaining
    }
  },
#endif

#ifdef  ZCL_RELATIVE_HUMIDITY
  // *** Relative Humidity Attriubtes ***
  {
    ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY,
    { // Attribute record
      ATTRID_MS_RELATIVE_HUMIDITY_MEASURED_VALUE,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
      (void *)&zclHumiditySensor_MeasuredValue
    }
  },
  
  {
    ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY,
    { // Attribute record
      ATTRID_MS_RELATIVE_HUMIDITY_MIN_MEASURED_VALUE,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclHumiditySensor_MinMeasuredValue
    }
  },
  
  {
    ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY,
    { // Attribute record
      ATTRID_MS_RELATIVE_HUMIDITY_MAX_MEASURED_VALUE,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclHumiditySensor_MaxMeasuredValue
    }
  },

    {
    ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY,
    { // Attribute record
      ATTRID_MS_RELATIVE_HUMIDITY_TOLERANCE,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclHumiditySensor_ToleranceValue
    }
  },
  
  {
    ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
#endif
  
#ifdef ZCL_ON_OFF
  // *** On/Off Cluster Attributes ***
  {
    ZCL_CLUSTER_ID_GEN_ON_OFF,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
#endif
  
#ifdef ZCL_TIME
  // *** Time Cluster Attributes ***
  {
    ZCL_CLUSTER_ID_GEN_TIME,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
  {
    ZCL_CLUSTER_ID_GEN_TIME,
    {  // Attribute record
      ATTRID_TIME_TIME,
      ZCL_DATATYPE_UTC,
      ACCESS_CONTROL_READ|ACCESS_CONTROL_WRITE,
      (void *)&zclTemperatureHumiditySensor_Time
    }
  },
#endif
#ifdef ZCL_HVAC_CLUSTER
  // *** FAN_CONTROL Cluster Attributes ***
  {
    ZCL_CLUSTER_ID_HVAC_FAN_CONTROL,
    {  // Attribute record
      ATTRID_CLUSTER_REVISION,
      ZCL_DATATYPE_UINT16,
      ACCESS_CONTROL_READ,
      (void *)&zclTemperatureHumiditySensor_clusterRevision_all
    }
  },
  {
    ZCL_CLUSTER_ID_HVAC_FAN_CONTROL,
    {  // Attribute record
      ATTRID_HVAC_FAN_CTRL_FAN_MODE,
      ZCL_DATATYPE_ENUM8,
      ACCESS_CONTROL_READ|ACCESS_CONTROL_WRITE,
      (void *)&zcl_FanMode_e8
    }
  },
#endif
};

uint8 CONST zclTemperatureHumiditySensor_NumAttributes = ( sizeof(zclTemperatureHumiditySensor_Attrs) / sizeof(zclTemperatureHumiditySensor_Attrs[0]) );

/*********************************************************************
 * SIMPLE DESCRIPTOR
 */
// This is the Cluster ID List and should be filled with Application
// specific cluster IDs.



const cId_t zclTemperatureHumiditySensor_InClusterList[] =
{
  ZCL_CLUSTER_ID_GEN_BASIC,
  ZCL_CLUSTER_ID_GEN_IDENTIFY,
  ZCL_CLUSTER_ID_GEN_TIME,
  //ZCL_CLUSTER_ID_HVAC_FAN_CONTROL,
#ifdef RTR_NWK
#else
  ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
  ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY
#endif
};
#define ZCLTEMPERATURE_HUMIDITY_SENSOR_MAX_INCLUSTERS  ( sizeof( zclTemperatureHumiditySensor_InClusterList ) / sizeof( zclTemperatureHumiditySensor_InClusterList[0] ))

const cId_t zclTemperatureHumiditySensor_OutClusterList[] =
{
  ZCL_CLUSTER_ID_GEN_BASIC,
  ZCL_CLUSTER_ID_GEN_IDENTIFY,
  ZCL_CLUSTER_ID_GEN_ON_OFF,
  ZCL_CLUSTER_ID_HVAC_FAN_CONTROL,
#ifdef RTR_NWK
  ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
  ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY
#endif
};
#define ZCLTEMPERATURE_HUMIDITY_SENSOR_MAX_OUTCLUSTERS ( sizeof( zclTemperatureHumiditySensor_OutClusterList ) / sizeof( zclTemperatureHumiditySensor_OutClusterList[0] ))

SimpleDescriptionFormat_t zclTemperatureHumiditySensor_SimpleDesc =
{
  TEMPERATURE_HUMIDITY_SENSOR_ENDPOINT,                  //  int Endpoint;
  ZCL_HA_PROFILE_ID,                                     //  uint16 AppProfId[2];
  ZCL_HA_DEVICEID_TEMPERATURE_SENSOR,                    //  uint16 AppDeviceId[2];
  TEMPERATURE_HUMIDITY_SENSOR_DEVICE_VERSION,            //  int   AppDevVer:4;
  TEMPERATURE_HUMIDITY_SENSOR_FLAGS,                     //  int   AppFlags:4;
  ZCLTEMPERATURE_HUMIDITY_SENSOR_MAX_INCLUSTERS,         //  byte  AppNumInClusters;
  (cId_t *)zclTemperatureHumiditySensor_InClusterList, //  byte *pAppInClusterList;
  ZCLTEMPERATURE_HUMIDITY_SENSOR_MAX_OUTCLUSTERS,        //  byte  AppNumInClusters;
  (cId_t *)zclTemperatureHumiditySensor_OutClusterList //  byte *pAppInClusterList;
};
 
/*********************************************************************
 * GLOBAL FUNCTIONS
 */

/*********************************************************************
 * LOCAL FUNCTIONS
 */

/*********************************************************************
 * @fn      zclSampleLight_ResetAttributesToDefaultValues
 *
 * @brief   Reset all writable attributes to their default values.
 *
 * @param   none
 *
 * @return  none
 */
void zclTemperatureHumiditySensor_ResetAttributesToDefaultValues(void)
{
  int i;
  
  zclTemperatureHumiditySensor_LocationDescription[0] = 16;
  for (i = 1; i <= 16; i++)
  {
    zclTemperatureHumiditySensor_LocationDescription[i] = ' ';
  }
  
  zclTemperatureHumiditySensor_PhysicalEnvironment = PHY_UNSPECIFIED_ENV;
  zclTemperatureHumiditySensor_DeviceEnable = DEVICE_ENABLED;
  
#ifdef ZCL_IDENTIFY
  zclTemperatureHumiditySensor_IdentifyTime = 0;
#endif
  
  zclTemperatureSensor_MeasuredValue = TEMPERATURE_SENSOR_MEASURED_VALUE;
  zclHumiditySensor_MeasuredValue = HUMIDITY_SENSOR_MEASURED_VALUE;
  
}


/****************************************************************************
****************************************************************************/


